import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int a,b;
        char c;
        while(true) {
        System.out.println("请输入第一个数：");
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        System.out.println("请输入第二个数：");
        b = sc.nextInt();
        System.out.println("请输入运算符：");
        c = sc.next().charAt(0);
            char x;
            switch (c) {
                case '+':
                    System.out.println("结果是："+ a + c + b + "=" + (a + b));
                    break;
                case '-':
                    System.out.println("结果是：" + a + c + b + "=" +(a - b));
                    break;
                case '*':
                    System.out.println("结果是：" + a + c + b + "=" + (a * b));
                    break;
                case '/':
                    System.out.println("结果是：" + a + c + b + "=" + (a / b));
                    break;
                default:
                    System.out.println("输入错误");
            }
            System.out.println("请问要退出吗？(Y/N)");
            x = new Scanner(System.in).next().charAt(0);
            if (x == 'Y') {
                System.out.println("程序结束！");
                break;
            }
        }

    }
}